class AddNestedSetCategories < ActiveRecord::Migration
  def self.up
    drop_table :categories
    create_table :categories do |t|
      t.string :name
      t.integer :parent_id
      t.integer :lft, :null => false
      t.integer :rgt, :null => false
      t.integer :lock_version, :default => 0
      t.integer :user_id
      t.timestamps
    end
  end

  def self.down
    drop_table :categories
    create_table :categories do |t|
      t.string :name
      t.integer :parent_id
    end
  end
end
